﻿using J.Status.Application.Command.BookingCommand;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.BookingHandler
{
    public class UpdateRoomStateHandler : IRequestHandler<UpdateRoomStateCommand, int>
    {
        private readonly IBookingService bookingService;

        public UpdateRoomStateHandler(IBookingService bookingService)
        {
            this.bookingService = bookingService;
        }

        public async Task<int> Handle(UpdateRoomStateCommand request, CancellationToken cancellationToken)
        {
            return await bookingService.UpdateRoomState(request.roomStareNumber,request.roomEndNumber);
        }
    }
}
